package com.yztstudy.Service.Impl;

import com.yztstudy.Entity.Cart;
import com.yztstudy.Mapper.CartMapper;
import com.yztstudy.Service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional
public class CartServiceImpl implements CartService {

    @Autowired
    private CartMapper cartMapper;

    @Override
    public Integer addCart(Cart cart) {
        return cartMapper.addCart(cart);
    }

    @Override
    public Integer updateCart(Cart cart) {
        return cartMapper.updateCart(cart);
    }

    @Override
    public Integer deleteCarts(Integer deskID) {
        return cartMapper.deleteCarts(deskID);
    }

    @Override
    public Integer deleteCartById(Integer id) {
        return cartMapper.deleteCartById(id);
    }

    @Override
    public Cart getCartById(Integer id) {
        return cartMapper.getCartById(id);
    }

    @Override
    public Integer isExist(Map<String, Object> map) {
        return cartMapper.isExist(map);
    }

    @Override
    public Cart getMyCart(Map<String, Object> map) {
        return cartMapper.getMyCart(map);
    }

    @Override
    public List<Cart> getCarts(Integer deskID) {
        return cartMapper.getCarts(deskID);
    }
}
